layui.define(['layer', 'form'], function(exports) {
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
    var select = {
        initNormal: function(filter, id, url) {
            $.ajax({
                type: 'get',
                url: url,
                dataType: 'json',
                success: function(response) {
                    var data = response.data;
                    layui.each(data, function(index, item) {
                        $("#" + id).append("<option value=\"" + item.realValue + "\">" + item.displayValue + "</option>");
                    });
                    form.render('select', filter);
                },
                error: function(e, m) {
                    alert("数据接口异常");
                    return;
                }
            });
        }
    };
    exports('select', select);


});